/**
 * @author Cator Vee  hi@catorv.com
 */
import { Component } from 'react'
import PropTypes from 'prop-types'
import wechat from '../lib/wechat'

export default class WechatHideMenu extends Component {
  componentDidMount () {
    wechat.hideMenuItems({menuList: this.props.items})
  }

  componentWillUnmount () {
    wechat.showAllNonBaseMenuItem()
  }

  render () {
    return null
  }
}

WechatHideMenu.propTypes = {
  items: PropTypes.array.isRequired
}
